Skip to content

fix(core): announce slot lifecycle to geyser plugins - #747

Open
snehendu098 wants to merge 3 commits into
solana-foundation:mainfrom
snehendu098:fix/announce-slot-lifecycle
Open

fix(core): announce slot lifecycle to geyser plugins#747
snehendu098 wants to merge 3 commits into
solana-foundation:mainfrom
snehendu098:fix/announce-slot-lifecycle

Conversation

@snehendu098

Copy link
Copy Markdown

Fixes #719

GeyserSlotStatus declared 2 of agave's 7 variants and only the Confirmed and Rooted were emitted. Processed was declared but never emitted. Consumers that reconstruct block data start tracking a slot only on a lifecycle status and drop block data for untracked slots, so the blocks metadata and entries surfpool produces get discarded on arrival

What I did was announce each newly opened slot with CreatedBank, plus on at startup for the genesis slot. I also emit Processed which is not really needed here but #719 actually depends on it. I can drop it also

Regression test drives five blocks through confirm_current_block and asserts every NotifyBlockMetadata and NotifyEntry is for a slot announced beforehand. Before the fix: block metadata for slot 32 was emitted before the slot was announced.

I verified with a geyser plugin logging every callback over approx 54 slots created_bank went from 0 to 55, and all 109 block-metadata, entry and transaction events landed on an announced slot

Note: I added FirstShredReceived and Completed but never emit them, as surfpool has no gossip layer. I kept them because the enum's doc comment says it mirrors agave's SlotStatus. I can trim that to only what's emitted also

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR expands Geyser slot lifecycle reporting so plugins can track slots before receiving their block data.

  • Uses Agave’s complete SlotStatus type directly.
  • Announces the initial and newly opened slots with CreatedBank.
  • Emits Processed before Confirmed and preserves rooted notifications.
  • Delays RPC availability until initial Geyser lifecycle events have been queued.
  • Adds regression coverage for lifecycle-before-block-data ordering.

Confidence Score: 5/5

The PR appears safe to merge based on the eligible follow-up review scope.

No blocking failure remains within the provided prior-thread context.

Important Files Changed

Filename Overview
crates/core/src/runloops/mod.rs Reorders RPC startup around initial Geyser notifications and forwards Agave slot statuses directly to plugins.
crates/core/src/surfnet/mod.rs Replaces the partial local Geyser status enum with Agave’s complete SlotStatus type.
crates/core/src/surfnet/svm.rs Emits CreatedBank and Processed lifecycle events and tests that block metadata and entries follow slot announcement.

Reviews (2): Last reviewed commit: "fix(runloop): adjust RPC server startup ..." | Re-trigger Greptile

@MicaiahReid
MicaiahReid self-requested a review August 11, 2026 21:08
@MicaiahReid
MicaiahReid force-pushed the fix/announce-slot-lifecycle branch from d9cd6a6 to 6ab0a7d Compare August 19, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slots / blocks / blocksMeta subscriptions deliver nothing

2 participants